<div class="header">
    <div class="main">
        <a class="logo" href="/" title="tdl-express">Logo</a>
        <div class="nav" style="height: 65px;">
            <php>
                $uri = $_SERVER['REQUEST_URI']; 
                if(strstr($uri,"/Content/Index/index")){ $url = 1; }
                if(strstr($uri,"/content/Article/detail")){ $url = 1; }
            </php>
            <style>
            	.index{display: inline-block;cursor: pointer;padding: 0 20px;color: #999;height: 40px;}
            	.index:hover{color: #fff;}
            	.index .nav-child{width: 80px;text-align: center;position: absolute;background-color: #393D49;display: none;top:40px;left: -5px;}
            	.index .nav-child a{padding: 0;display: inline-block;width: 100%;padding: 5px 0;}
            </style>
            <if condition = "$_SESSION['loginUser']['uid']">
	        		<if condition="$url">
		                <div class="index" onclick="window.location='/'"  onmouseover="shows()" onmouseout="hides()">
		                	首页
		                	
		                </div>
		                
		            <else/>
		                <div class="nav-this index" onclick="window.location='/'"  onmouseover="shows()" onmouseout="hides()">
		                	首页
		                	
		                	<div class="nav-child" id="nav-child"> <!-- 二级菜单 -->
						    	<a href="#">这是</a>
				        		<a href="#">二级</a>
				        		<a href="#">菜单</a>
				        		
						    </div>
		                	
		                </div>
		            </if>
		            <if condition="$_SESSION['loginUser']['role'] == 'SUPER_ADMIN'|| $_SESSION['loginUser']['role'] =='BACKSTAGE_ADMIN'">
		                <a href="/admin.html">后台</a>
		            </if>
		       		
    		<else/>
        		<div class="index" onclick="window.location='/'"  onmouseover="shows()" onmouseout="hides()">
		                      首页
		        </div>
				<div class="index" onclick="window.location='/'"  onmouseover="shows()" onmouseout="hides()">
		                      未登录菜单
		        </div>
				
        	</if>
            
        </div>

        <div class="nav-user">
            <if condition="!$_SESSION['loginUser']">
                <a class="unlogin" href="/user/login.html"><i class="iconfont icon-touxiang"></i></a>
                <span><a href="/user/login.html">{:L('login')}</a><a href="/user/reg.html">{:L('reg')}</a></span>
                <else/>
                <a class="avatar" href="/user/index.html">
                    <img src="{$_SESSION['loginUser']['avater']|default='/Public/res/images/avatar/default.png'}" id="nav_avatar_image">
                    <cite>{$_SESSION['loginUser']['school_name']}&nbsp;&nbsp;&nbsp;&nbsp;{$_SESSION['loginUser']['username']}</cite>
                    <!-- <i>VIP2</i> -->
                </a>
                <div class="nav">
                    <!--
                    <a href="/user/setting.html"><i class="iconfont icon-shezhi"></i>{:L('set')}</a>
                    -->
                    <a href="/user/login/logout.html"><i class="icon iconfont icon-index-tuichu" style="top: 3px; font-size: 21px;"></i>{:L('logout')}</a>
                </div>
            </if>
        </div>


    </div>
</div>
<script>
	function shows(){
		var obj = document.getElementById("nav-child");
		obj.style.display="block";
	}
	function hides(){
		var obj = document.getElementById("nav-child");
		obj.style.display="none";
	}
</script>